//
//  TMHNavigationController.m
//  NoNeedle
//
//  Created by Ming Tian on 2017/3/2.
//  Copyright © 2017年 Ming Tian. All rights reserved.
//

#import "TMHNavigationController.h"

@interface TMHNavigationController ()

@end

@implementation TMHNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavBar];
    [self configNavigationItem];
}

-(void)setNavBar {
    self.navigationBar.translucent = NO;
    self.navigationBar.barTintColor = NavBackColor;
    self.navigationBar.tintColor = [UIColor whiteColor];
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont boldSystemFontOfSize:18]}];
    // back
    [self.navigationBar setBackIndicatorImage:[UIImage imageNamed:@"icon_nav_return"]];
    [self.navigationBar setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"icon_nav_return"]];
    // 设置返回按钮文字偏移
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];
    
    //自定义一个NaVIgationBar
    [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    //消除阴影
    self.navigationBar.shadowImage = [UIImage new];
    
    
    UIBarButtonItem *buttonItem = [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil];
    
    
    UIOffset offset;
    
    offset.horizontal = -500;
    
    [buttonItem setBackButtonTitlePositionAdjustment:offset forBarMetrics:UIBarMetricsDefault];
    
}
- (void)configNavigationItem {
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
